package com.jungle.base.enums;

import java.util.Arrays;
import java.util.Objects;

public enum DebitCredit {
    /**
     * 借方
     */
    DEBIT,
    /**
     * 贷方
     */
    CREDIT;

    public static DebitCredit nameOf(String name) {
        return name == null ? null : Arrays.stream(values()).filter(type -> Objects.equals(type.name(), name)).findAny().orElse(null);
    }

}
